package com.yunbao.controller;

import com.yunbao.pojo.Resume;
import com.yunbao.service.ResumeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * Created by louisyuu on 2020/3/14 下午10:05
 */

@Controller
@RequestMapping("/resume")
public class ResumeController {

    @Autowired
    private ResumeService resumeService;


    @RequestMapping("/list")
    @ResponseBody
    public List<Resume> getResumes() {
        return resumeService.getResumes();
    }


    @RequestMapping("/insert")
    @ResponseBody
    public void insert(Resume resume) {
        resumeService.insert(resume);
    }


    @RequestMapping("/update")
    @ResponseBody

    public void update(Resume resume) {
        resumeService.update(resume);
    }


    @RequestMapping("/delete")
    @ResponseBody
    public void delete(Long id) {
        resumeService.delete(id);
    }
}
